<template>
    <el-dialog :title="title" :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true" :visible.sync="visible" :width="'480px'">
      <el-form :model="priceTypeForm" label-width="100px" size="small">
        <el-row :gutter="10">
          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
            <el-form-item label="价格类型名称">
                <el-input size="small" v-model.trim="priceTypeForm.name" placeholder="请输入价格类型名称" maxlength="30"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
            <el-form-item label="价格描述">
                <el-input type="textarea" :autosize="{ minRows: 3, maxRows: 5}" size="small" v-model.trim="priceTypeForm.desc" placeholder="请输入价格类型描述" maxlength="200"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="closeModel()">取 消</el-button>
        <el-button type="primary" :loading="submitLoading" @click="closeModel()">确 定</el-button>
      </div>
    </el-dialog>
</template>

<script>
export default {
    props: ['visible', 'title'],
    data() {
        return {
            priceTypeForm: {
                name: '',
                desc:''
            },
            submitLoading: false
        }
    },
    methods: {
        closeModel() {
            this.$emit('update:visible', false);
        }
    }
}
</script>
